package c.j.a.c;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import c.j.a.a.a.c.a.a;
import c.j.a.a.a.c.d;
import c.j.a.a.a.c.e;
import c.j.a.c.g.s;
import c.j.a.c.g.t;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/* compiled from: DownloadDispatcher */
public class x {
    public static volatile x f;
    public final Handler a = new Handler(Looper.getMainLooper());
    public final List<t> b = new CopyOnWriteArrayList();
    public final Map<String, t> c = new ConcurrentHashMap();
    public final CopyOnWriteArrayList<a> d = new CopyOnWriteArrayList();
    public long e;

    public static x b() {
        if (f == null) {
            synchronized (x.class) {
                if (f == null) {
                    f = new x();
                }
            }
        }
        return f;
    }

    public s a(String str) {
        Map map = this.c;
        if (!(map == null || map.size() == 0 || TextUtils.isEmpty(str))) {
            t tVar = (t) this.c.get(str);
            if (tVar instanceof s) {
                return (s) tVar;
            }
        }
        return null;
    }

    public final void c(Context context, int i, e eVar, d dVar) {
        if (dVar != null) {
            s sVar = new s();
            sVar.b(context);
            sVar.c(i, eVar);
            sVar.e(dVar);
            sVar.a();
            this.c.put(dVar.a(), sVar);
        }
    }
}
